<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>积分赠送</title>
		<jsp:include page="/page/jsp/member/head.jsp" />
		<script type="text/javascript">
			
			//点击编辑数据添加到编辑中
			function add(){
				window.location = path+"/member/gift-init.htm";
			}
			
			//删除
			function deleteSGRs(id){
				if(id!=""){
					$.ajax({
						   url: path+"/member/deleteSGRs.htm?id="+id,
						   success: function(data){
							   if(data=="0"){
								   window.location = path+"/member/presented.htm";   //成功跳回查看页面
							   }else{
								   alertBox("操作失败!");
							   }
						   }
					});
					
				}
			}
			
			
		</script>
	</head>
<body>
	<div class="right2">
	<h1><b>积分赠送</b></h1>
		<div class="ri_main2">
			<div id="toolbar">
			<input type="button" onclick="add()" value="赠送积分" />
			</div>
			  <table width="100%" id="mgrTable" border="0" cellpadding="8" cellspacing="1" class="margintop10" style="background:#d9d9d9;">
			    <tr>
			      <td width="7%" bgcolor="#eeeeee"><b>序号</b></td>
			      <td width="8%" bgcolor="#eeeeee"><b>发起人</b></td>
			      <td width="8%" bgcolor="#eeeeee"><b>接收人</b></td>
			      <td width="10%" bgcolor="#eeeeee"><b>赠送积分</b></td>
			      <td width="35%" bgcolor="#eeeeee"><b>备注</b></td>
			      <td width="13%" bgcolor="#eeeeee"><b>赠送时间</b></td>
			      <td width="10%" bgcolor="#eeeeee"><b>操作</b></td>
			    </tr>
			    <c:forEach var="sgrs" items="${sGiftRecords}" varStatus="s">
				  <tr>
				      <td bgcolor="#FFFFFF"><c:out value="${s.count}" /></td>
				      <td bgcolor="#FFFFFF">${sgrs.fromName}</td>
				      <td bgcolor="#FFFFFF">${sgrs.toName}</td>
				      <td bgcolor="#FFFFFF">￥ ${sgrs.score}</td>
				      <td bgcolor="#FFFFFF">${sgrs.remark}</td>
				      <td bgcolor="#FFFFFF">${sgrs.time()}</td>
				      <td bgcolor="#FFFFFF">
				        <input type="button" onclick="deleteSGRs(${sgrs.id})" value="删除" />
				      </td>
				  </tr>
			    </c:forEach>
			    
			    </table>
		</div>
	</div>
</body>
</html>